package com.ftg.learn.bus.control_list.control_list_controller;

import com.ftg.learn.bus.control_list.control_list_pojo.control_list;
import com.ftg.learn.bus.control_list.service.control_list_service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@Api(value = "权限表",tags = "对角色赋权")
public class control_list_controler {
    @Autowired
    control_list_service cls;

    @PutMapping("/control/list/query/{role_id}")
    @ApiOperation("根据角色id查询角色的权限")
    public List<Map<String,Object>> query(@ApiParam("角色id") @PathVariable String role_id){
        return cls.query(role_id);
    }

    @PostMapping("/control/list/insert")
    @ApiOperation("根据角色id赋予/修改角色的权限")
    public int insertOrUpdate(@RequestBody control_list cl){
        return cls.insertOrUpdate(cl);
    }
}
